<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff, branch 1.45.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.45.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.45.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2020-06-26T13:34:18+00:00</updated>
<entry>
<title>Disable the `SimplifyArmIdentity` pass on beta</title>
<updated>2020-06-26T13:34:18+00:00</updated>
<author>
<name>Wesley Wiser</name>
<email>wwiser@gmail.com</email>
</author>
<published>2020-06-12T00:46:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=483608a4d2de8a828e7292f4d3686acbd030e0e7'/>
<id>urn:sha1:483608a4d2de8a828e7292f4d3686acbd030e0e7</id>
<content type='text'>
This pass is buggy so I'm disabling it to fix a stable-to-beta
regression.

Related to #73223
</content>
</entry>
<entry>
<title>Modify SimplifyArmIdentity so it can trigger on mir-opt-level=1</title>
<updated>2020-05-12T00:31:02+00:00</updated>
<author>
<name>Wesley Wiser</name>
<email>wwiser@gmail.com</email>
</author>
<published>2020-05-12T00:13:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6de6d70ae0a21b779d63d885438c7214e17e7a6d'/>
<id>urn:sha1:6de6d70ae0a21b779d63d885438c7214e17e7a6d</id>
<content type='text'>
I also added test cases to make sure the optimization can fire on all of
these cases:

```rust
fn case_1(o: Option&lt;u8&gt;) -&gt; Option&lt;u8&gt; {
  match o {
    Some(u) =&gt; Some(u),
    None =&gt; None,
  }
}

fn case2(r: Result&lt;u8, i32&gt;) -&gt; Result&lt;u8, i32&gt; {
  match r {
    Ok(u) =&gt; Ok(u),
    Err(i) =&gt; Err(i),
  }
}

fn case3(r: Result&lt;u8, i32&gt;) -&gt; Result&lt;u8, i32&gt; {
  let u = r?;
  Ok(u)
}

```

Without MIR inlining, this still does not completely optimize away the
`?` operator because the `Try::into_result()`, `From::from()` and
`Try::from_error()` calls still exist. This does move us a bit closer to
that goal though because:

- We can now run the pass on mir-opt-level=1

- We no longer depend on the copy propagation pass running which is
  unlikely to stabilize anytime soon.
</content>
</entry>
</feed>
